package com.base.cn.platform.os.controller.statistics.goods;

import com.base.cn.platform.os.common.controller.BaseController;
import com.base.cn.platform.os.common.utils.ObjectUtils;
import com.base.cn.platform.os.common.utils.result.ResultUtil;
import com.base.cn.platform.os.entity.statistics.goods.ZStatisticsGoodsPVCount;
import com.base.cn.platform.os.service.statistics.goods.ZStatisticsGoodsPVCountBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 商品PV统计Controller
 *
 * @author s.li
 * @date 2019/04/28
 */
@RestController
@RequestMapping("/manage/statistics")
public class ZStatisticsGoodsPVCountController extends BaseController {

    @Autowired
    private ZStatisticsGoodsPVCountBiz zStatisticsGoodsPVCountBiz;

    /**
     * 生成商品PV统计记录
     * @param goodsPVCountList
     */
    @RequestMapping("/genGoodsPVCountList")
    public Map<String,Object> genGoodsPVCountList(@RequestBody List<ZStatisticsGoodsPVCount> goodsPVCountList){
        if(ObjectUtils.isNotEmpty(goodsPVCountList)){
            zStatisticsGoodsPVCountBiz.genGoodsPVCountList(goodsPVCountList);
        }
        return ResultUtil.SUCCESS();
    }
}
